

varying vec3 vNormal;
varying vec3 vView;
varying vec2 vTexCoord;

uniform samplerCube	gCubeMap;
uniform sampler2D	gSurface;

void main() {

	vec3 vRefract = textureCube(gCubeMap, refract(vView, vNormal, 1.0));
	vec3 vReflect = textureCube(gCubeMap, reflect(vView, vNormal));

	gl_FragColor = vec4(mix( mix(vRefract, vReflect, 0.8).rgb, texture2D(gSurface, vTexCoord).rgb, 0.4), 0.5);
}
